﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    .style6
    {
        width: 100%;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<br />
<br /> 
<table width="100%" border="0" cellpadding="4" cellspacing="0">
    <tr>
        <td class="table_header">  
    <asp:Label ID="Label1" runat="server" 
    Text="Sản phẩm mới"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <asp:DataList ID="DataSanPhamMoi" runat="server" CellPadding="10" 
        RepeatColumns="5">
        
                <ItemTemplate>
                    <table class="style6">
                        <tr>
                            <td align="center">
                                <asp:Label ID="TenSanPham" runat="server" Text='<%# Eval("TenSanPham") %>' 
                                    Font-Bold="True"></asp:Label>
                                <asp:HiddenField ID="Hidden" runat="server" value='<%# Eval("ID") %>' />
                            <% 
                                DataSanPhamMoi.EditItemIndex += 1;
                                HiddenField idsanpham = (HiddenField)DataSanPhamMoi.Items[DataSanPhamMoi.EditItemIndex].Controls[1];

                                int id = int.Parse(idsanpham.Value);
                                DTO.SanPhamDto sanpham = BUS.SanPhamBus.LaySanPhamTheoID(id);
                                int songay = (DateTime.Today - sanpham.NgayNhap).Days;
                                if (songay < 30)
                                {           
                            %>
                                    <img alt="" src='images/new.gif' width='15px' height='15px' />
                            <%  } %>
                            </td>
                        </tr>
                        <tr>
                            <td align="center">
                                <asp:HyperLink ID="HyperLink1" runat="server" 
                                    NavigateUrl='<%# "Details.aspx?itemID=" + Eval("ID") %>'><img border="0px" src='<%# Eval("Hinh") %>' width='112px' height='101px' /></asp:HyperLink>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="login_text" >
                                <asp:Label ID="Label3" runat="server" Text='<%# Eval("DonGia") + ".000 VND"%>' 
                                    Font-Size="8pt" ForeColor="White" Font-Bold="True"></asp:Label>
                      
                                <asp:HyperLink ID="Gio" runat="server" ImageUrl="~/images/index_56.gif" 
                                    NavigateUrl='<%# "Cart.aspx?itemID=" + Eval("ID") %>' 
                                    Height="18px"></asp:HyperLink>
                            </td>
                        </tr>
                        
                    </table>
                </ItemTemplate>
            </asp:DataList>
        </td>
    </tr>
</table>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="ResultList.aspx?name=moi" ForeColor="White" Font-Underline="False">Xem tat ca...</asp:HyperLink>
<br />
<br />
<table width="100%" border="0" cellpadding="4" cellspacing="0">
    <tr>
        <td class="table_header">  
<asp:Label ID="Label4" runat="server" Text="Sản Phẩm Bán Chạy" ></asp:Label>
        </td>
    </tr>
    <tr><td>
<asp:DataList ID="DataSanPhamBanChay" runat="server" CellPadding="10" 
    RepeatColumns="5">
    <ItemTemplate>
        <table class="style6">
            <tr>
                <td align="center">
                    <asp:Label ID="TenSanPham" runat="server" Text='<%# Eval("tensanpham") %>' 
                        Font-Bold="True"></asp:Label>
                      <asp:HiddenField ID="Hidden2" runat="server" value='<%# Eval("ID") %>' />
                            <% 
                                DataSanPhamBanChay.EditItemIndex += 1;
                                HiddenField idsanpham2 = (HiddenField)DataSanPhamBanChay.Items[DataSanPhamBanChay.EditItemIndex].Controls[1];

                                int id2 = int.Parse(idsanpham2.Value);
                                DTO.SanPhamDto sanpham2 = BUS.SanPhamBus.LaySanPhamTheoID(id2);
                                int songay2 = (DateTime.Today - sanpham2.NgayNhap).Days;
                                if (songay2 < 30)
                                {           
                            %>
                                    <img alt="" src='images/new.gif' width='15px' height='15px' />
                            <%  } %>
                </td>
            </tr>
            <tr>
                <td align="center">
                  <asp:HyperLink ID="image2" runat="server"  
                        NavigateUrl='<%# "Details.aspx?itemID=" + Eval("ID") %>'><img border="0px" src='<%# Eval("Hinh") %>' width='112px' height='101px' /></asp:HyperLink>
                   
                </td>
            </tr>
            <tr>
                <td align="right" class="login_text" >
                    <asp:Label ID="Label6" runat="server" Text='<%# Eval("DonGia") + ".000 VND"%>' Font-Size="8pt" ForeColor="White" Font-Bold="True"></asp:Label>
            
                    <asp:HyperLink ID="Gio" runat="server" ImageUrl="~/images/index_56.gif" 
                        NavigateUrl='<%# "Cart.aspx?itemID=" + Eval("ID") %>' Height="20px">[Gio]</asp:HyperLink>
                </td>
            </tr>
            
        </table>
    </ItemTemplate>
</asp:DataList>
        </td>
    </tr>
</table>
<br />
<table width="100%" border="0" cellpadding="4" cellspacing="0">
    <tr>
        <td class="table_header">  
    <asp:Label ID="Label7" runat="server" Text="Sản Phẩm Yêu Thích"></asp:Label>
        </td>
     </tr>
     <tr><td>
    <asp:DataList ID="DataSanPhamYeuThich" runat="server" CellPadding="10" 
        RepeatColumns="5">
        <ItemTemplate>
            <table class="style6">
                <tr>
                    <td align="center">
                        <asp:Label ID="TenSanPham" runat="server" Text='<%# Eval("tensanpham") %>' 
                            Font-Bold="True"></asp:Label>
                          <asp:HiddenField ID="Hidden3" runat="server" value='<%# Eval("ID") %>' />
                            <% 
                                DataSanPhamYeuThich.EditItemIndex += 1;
                                HiddenField idsanpham3 = (HiddenField)DataSanPhamYeuThich.Items[DataSanPhamYeuThich.EditItemIndex].Controls[1];

                                int id3 = int.Parse(idsanpham3.Value);
                                DTO.SanPhamDto sanpham3 = BUS.SanPhamBus.LaySanPhamTheoID(id3);
                                int songay3 = (DateTime.Today - sanpham3.NgayNhap).Days;
                                if (songay3 < 30)
                                {           
                            %>
                                    <img alt="" src='images/new.gif' width='15px' height='15px' />
                            <%  } %>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                     
                        <asp:HyperLink ID="image3" runat="server"  
                        NavigateUrl='<%# "Details.aspx?itemID=" + Eval("ID") %>'><img border="0px" src='<%# Eval("Hinh") %>' width='112px' height='101px' /></asp:HyperLink>
                   </td>
                </tr>
                <tr>
                    <td class="login_text"  >
                        <asp:Label ID="Label9" runat="server" Text='<%# Eval("DonGia") +".000 VND"%>' Font-Size="9pt" ForeColor="White" Font-Bold="True"></asp:Label>
                        <asp:HyperLink ID="Gio3" runat="server" ImageUrl="~/images/index_56.gif" 
                            NavigateUrl='<%# "Cart.aspx?itemID=" + Eval("ID") %>' Height="20px">Gio</asp:HyperLink>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:DataList>
            </td>
    </tr>
</table>
    <br />
    
   <table width="100%" border="0" cellpadding="4" cellspacing="0">
    <tr>
        <td class="table_header">   
    <asp:Label ID="Label6" runat="server" Text="Sản phẩm đang khuyến mãi" ></asp:Label>
               </td>
     </tr>
     <tr><td>
    
    <asp:DataList ID="DataSanPhamKhuyenMai" runat="server" CellPadding="10" 
        RepeatColumns="5">
        <ItemTemplate>
            <table class="style6">
                <tr>
                    <td align="center">
                        <asp:Label ID="TenSanPham" runat="server" Text='<%# Eval("tensanpham") %>' 
                            Font-Bold="True"></asp:Label>
                          <asp:HiddenField ID="Hidden4" runat="server" value='<%# Eval("ID") %>' />
                            <% 
                                DataSanPhamKhuyenMai.EditItemIndex += 1;
                                HiddenField idsanpham4 = (HiddenField)DataSanPhamKhuyenMai.Items[DataSanPhamKhuyenMai.EditItemIndex].Controls[1];

                                int id4 = int.Parse(idsanpham4.Value);
                                DTO.SanPhamDto sanpham4 = BUS.SanPhamBus.LaySanPhamTheoID(id4);
                                int songay4 = (DateTime.Today - sanpham4.NgayNhap).Days;
                                if (songay4 < 30)
                                {           
                            %>
                                    <img alt="" src='images/new.gif' width='15px' height='15px' />
                            <%  } %>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                    <asp:HyperLink ID="image2" runat="server"  
                           NavigateUrl='<%# "Details.aspx?itemID=" + Eval("ID") %>'><img border="0px" src='<%# Eval("Hinh") %>' width='112px' height='101px' /></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="login_text" 
                        
                        style="color: #FFFFFF; font-weight: bold; ">
                        <asp:Label ID="Label6" runat="server" Text='<%# Eval("DonGia")+ ".000VND" %>' 
                            Font-Strikeout="True" Font-Size="8pt" ForeColor="White" Font-Bold="True"></asp:Label>
                    
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("IDgiamgia")+ ".000 VND"%>' Font-Size="8pt" ForeColor="White"></asp:Label>
                        
                        <asp:HyperLink ID="Gio4" runat="server" ImageUrl="~/images/index_56.gif" 
                            NavigateUrl='<%# "Cart.aspx?itemID=" + Eval("ID") %>' Height="20px"></asp:HyperLink>
                        </td>
                </tr>
                
            </table>
        </ItemTemplate>
    </asp:DataList>
                </td>
    </tr>
</table>
    <asp:HyperLink ID="linkspKhuyenMai" runat="server" NavigateUrl="ResultList.aspx?name=khuyenmai" ForeColor="White" Font-Underline="False">Xem tat ca...</asp:HyperLink>
    <br />
</asp:Content>

